<?php

class Workset_Filter_StripPrefix implements Zend_Filter_Interface {

    function filter($fields, $prefix) {
        $prefix = $prefix.'_';
        foreach ($fields as $key => $value) {
            if (0 === strpos($key, $prefix)) {
                $newKey = substr($key, strlen($prefix));
                unset($fields[$key]);
                $fields[$newKey] = $value;
            }
        }
        return $fields;
    }

}

?>